<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="t_product" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="financialConfirmDetSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>确认</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 产品详情 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="产品名称" prop="">
              {{t_product.product_name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="产品编号" prop="">
              {{t_product.product_barcode}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="规格型号" prop="">
              {{t_product.model_norm}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="储存位置" prop="">
              {{t_product.name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="结余数" prop="">
              {{t_product.product_num}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存数" prop="">
              {{t_product.take_num}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="差异数" prop="">
              {{t_product.pln}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="会计" prop="">
              {{t_product.contact_name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="处理时间" prop="">
              {{t_product.take_accoun_date}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 出入单 </span>
      </div>
      <el-table :data="s_pstock">
        <el-table-column label="出入库类型" prop="stock_category">
          <template slot-scope="scope">
            {{getValueName("入库=1,出库=2",scope.row.stock_category)}}
          </template>
        </el-table-column>
        <el-table-column label="出入库条形码" prop="stock_barcode">
        </el-table-column>
        <el-table-column label="出入库名称" prop="stock_name">
        </el-table-column>
        <el-table-column label="入库供应商" prop="client_name">
        </el-table-column>
        <el-table-column label="产品条形码" prop="product_barcode">
        </el-table-column>
        <el-table-column label="产品名称" prop="product_name">
        </el-table-column>
        <el-table-column label="规格型号" prop="model_norm">
        </el-table-column>
        <el-table-column label="仓库区域" prop="name">
        </el-table-column>
        <el-table-column label="价格" prop="product_price">
        </el-table-column>
        <el-table-column label="数量" prop="product_num">
        </el-table-column>
        <el-table-column label="备注" prop="remark">
        </el-table-column>
        <el-table-column label="" prop="">
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'FinancialConfirmDet',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        t_product: {
          product_name: null,
          product_barcode: null,
          model_norm: null,
          name: null,
          product_num: null,
          take_num: null,
          pln: null,
          contact_name: null,
          take_accoun_date: null,
        },
        s_pstock: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/financialConfirmDet?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      financialConfirmDetSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/psi/main/InventoryAction/financialConfirmDetSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/psi/supplychainmana/FinManConfirm/finManConfirm?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
